/**
 * 选择考点弹窗
 *
 * @param subjectIds 考点专业
 * @param chkStyle 勾选框类型 checkbox/radio
 * @param callback 回调
 */
function selectLoresetPoint(subjectIds, chkStyle, callback) {
    if (!validSubject(subjectIds)) {
        icModale(0, '请同时指定专业和科目');
        return;
    }
    parent.layer.open({
        area: ['900px', '520px'],
        btn: ['确定'],
        content: baseloaction + "/admin/manage/point/findLoresetPointBySubjectPage?subjectIds=" + subjectIds + '&chkStyle=' + chkStyle,
        maxmin: true, //开启最大化最小化按钮
        shade: [0.3, '#000000'],
        shadeClose: false,
        title: '<strong>选择考点</strong>',
        type: 2,
        yes: function (index) {
            var body = parent.layer.getChildFrame('body', index);
            var loresetPoint = body.find('#loresetPoint').html();
            if(loresetPoint!=""){
                var array = JSON.parse(decodeURIComponent(loresetPoint));
            }
            if ($.isFunction(callback)) {
                callback(array);
            }
            parent.layer.close(index);
        }
    });
}

/**
 * 校验专业
 *
 * @param param
 * @returns {boolean}
 */
function validSubject(param) {
    if (param) {
        var length = param.trim().split(',').filter(function (v) {
            if ($.isNumeric(v)) {
                return v;
            }
        }).length;
        return length >= 1;
    }
    return false;

}